package cn.ycc1.springquickstart.util;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * 实现ApplicationContext为单例模式
 *
 * @author ycc
 * @date 2024/3/24
 */
public final class ApplicationContextUtil {
    private static ApplicationContext ac = null;

    private ApplicationContextUtil() {

    }
    static {
        ac = new ClassPathXmlApplicationContext("bean.xml");
    }

    public static ApplicationContext getApplicationContext() {
        return ac;
    }
}
